package com.my.hzb.util;

import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.ArrayList;
import java.util.List;

import com.my.hzb.entiy.UserInfo;

public class TestQuery {

	public static String name = "com.mysql.jdbc.Driver";  
	public static String url = "jdbc:mysql://192.168.182.128:3311/user";  
    public static String user = "root";  
    public static String password = "mytest";  
	public static Connection conn = DBUtil.getConn(name, url, user, password);
	public static PreparedStatement pst = null;
	public static ResultSet rs = null;
	
	public static void getAll(String sql){
		try {
			pst = conn.prepareStatement(sql);
			rs = pst.executeQuery();
			System.out.println(rs.getRow());
			while(rs.next()){
				System.out.println(rs.getObject("id"));
				System.out.println(rs.getObject("user_name"));
		    }
		} catch (SQLException e) {
			e.printStackTrace();
		}
	}
	public static void main(String[] args) {
		UserInfo u = new UserInfo();
//		getAll("select * from user_info where status=0 limit 10");
		String str = "12,123,1234,12345";
		System.out.println(str);
		str = str.replace("12","");
		System.out.println(str);
	}
}
